package com.nattakute.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nattakute.dao.ComplaintDAO;
import com.nattakute.model.Complaint;
import com.nattakute.service.ComplaintService;

@Transactional
@Service("complaintService")
public class ComplaintServicesImpl implements ComplaintService{

	@Autowired
	private ComplaintDAO complaintDAO;
	
	public List<Complaint> getComplaint() {
		// TODO Auto-generated method stub
		return complaintDAO.getComplaint();
	}

	
	public Complaint getComplaintById(Integer id) {
		// TODO Auto-generated method stub
		return complaintDAO.getComplaintById(id);
	}

	
	@Transactional
	public Boolean addComplaint(Complaint complaint) {
		// TODO Auto-generated method stub
		return complaintDAO.addComplaint(complaint);
	}

	
	@Transactional
	public Boolean deleteComplaint(Complaint complaint) {
		// TODO Auto-generated method stub
		return complaintDAO.deleteComplaint(complaint);
	}

	
	@Transactional
	public Boolean updateComplaint(Complaint complaint) {
		// TODO Auto-generated method stub
		return complaintDAO.updateComplaint(complaint);
	}

	
	@Transactional
	public List<Complaint> getListCompaintByUser(int userID) {
		// TODO Auto-generated method stub
		return complaintDAO.getListCompaintByUser(userID);
	}

	
	@Transactional
	public List<Complaint> getListComplaintBySolveUser(int userID) {
		// TODO Auto-generated method stub
		return complaintDAO.getListComplaintBySolveUser(userID);
	}


	public void setComplaintDAO(ComplaintDAO complaintDAO) {
		this.complaintDAO = complaintDAO;
	}

	
	
}
